<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>jquery选择器</title>
		<script src="js/jquery-1.12.4.min.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			$(function(){
				$("input[type='button']").bind("click",function(){
					console.info("选择器1:");
					$.each($("ul li:nth-child(5)"), function(i,n) {
						console.info("Item #"+i+":"+n.innerHTML);
					});
					console.info("选择器2");
					$.each($("ul li:contains('列表5')"), function(i,n) {
						console.info("Item #"+i+":"+n.innerHTML);
					});
					console.info("选择器3");
					$.each($(".red"), function(i,n) {
						alert("Item #"+i+":"+n.style.backgroundColor);
					});
				});
			});
		</script>
	</head>
	<body>
		<input type="button" value="点击测试" />
		<ul>
			<li>列表1</li>
			<li>列表2</li>
			<li class="red" style="height: 30px;background-color: aqua;">列表3</li>
			<li>列表4</li>
			<li>列表5</li>
			<li>列表6</li>
		</ul>
		<ul>
			<li>列表1</li>
			<li>列表2</li>
			<li>列表3</li>
			<li>列表4</li>
			<li>列表5</li>
			<li>列表6</li>
		</ul>
		<input type="text" />
		<h3>我是标题</h3>
	</body>
</html>
